Skip to content

Conversation

@scotts
Copy link
Contributor

@scotts scotts commented Oct 18, 2025

Two refactors:

  1. Resource generation, generate_reference_resources.py, is now more deeply integrated with our testing utils. This allows us to greatly simplify the resource generation, and it keeps the actual definitions in utils.py. That is, the video we define in utils.py defines the filename, and it has the logic for how to name reference frames.
  2. Moves around definitions in utils.py so that we group all video and audio test files together.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 18, 2025
@scotts scotts marked this pull request as ready for review October 18, 2025 18:48
Copy link
Contributor

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the FFmpeg4 issue is known

Dumb Q, but why do we generate those test resources across all FFmpeg versions in our CI?

https://github.com/meta-pytorch/torchcodec/blame/1befed7063e62b803da0927567d34d18c62a54a3/.github/workflows/reference_resources.yaml#L56

IIRC, we've only been using FFmpeg 4 for the reference generation so far?

@scotts
Copy link
Contributor Author

scotts commented Oct 20, 2025

@NicolasHug, good question. While we generated all of these resources originally with FFmpeg 4, they're actually stable across all versions we test against. For example, I've been using FFmpeg 6 for all of my testing the past several months, and when I re-run the resource generation script, everything comes out clean - we're bit-for-bit compatible with what we originally checked in.

This may seem surprising at first, but if we expect TorchCodec to be bit-for-bit compatible across versions, it's not surprising if the ffmpeg CLI is as well. I think that at the least, we'd want to know if our resource generation script was giving different results across FFMpeg versions.

I think we do have a comment somewhere about using FFmpeg 4. We should probably delete it, if we haven't already.

@scotts scotts merged commit c4bca2d into meta-pytorch:main Oct 20, 2025
65 of 66 checks passed
@scotts scotts deleted the refactor_gen_resources branch October 20, 2025 21:47
NicolasHug pushed a commit to NicolasHug/torchcodec that referenced this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants